package com.glodon.paas.account.dao.mysql;
 
import org.springframework.beans.factory.annotation.Autowired;

import com.glodon.paas.account.dao.AvatarDao; 
import com.glodon.paas.account.dao.domain.AvatarEntity;
import com.glodon.paas.account.dao.mapper.AvatarEntityMapper;

public class AvatarDaoMysqlImpl   implements AvatarDao {
	@Autowired
	private AvatarEntityMapper avatarEntityMapper;
	
	@Override
	public String insert(AvatarEntity entity) {
		avatarEntityMapper.insert(entity);
		return entity.getId();
	}

	@Override
	public AvatarEntity get(String id) {
		return avatarEntityMapper.selectByPrimaryKey(id);
	}

	@Override
	public int delete(String id) {
		return  avatarEntityMapper.deleteByPrimaryKey(id);
	} 
}
